Skip to content

Zig 0.16#36

Open
SonyCore wants to merge 1 commit into
const-void:masterfrom
SonyCore:master
Open

Zig 0.16#36
SonyCore wants to merge 1 commit into
const-void:masterfrom
SonyCore:master

Conversation

@SonyCore

Copy link
Copy Markdown

Zig 0.16 Migration — src/main.zig

  • I/O types removed. std.fs.File.Writer and std.fs.File.Reader no longer exist as Zig 0.16 rewrote the
    entire I/O system around an Io event-loop abstraction. Rather than wiring up the new async-capable API, the
    fix uses libc directly: std.c.write() for stdout output and std.c.read() for stdin input, keyed on the
    POSIX file descriptor constants std.posix.STDOUT_FILENO / std.posix.STDIN_FILENO.

  • std.io namespace removed. std.io.getStdOut().writer() and .reader() no longer exist; the global
    initialization in main() was simply deleted since we now use raw fds.

  • std.fs.cwd().openFile() removed. The filesystem API also moved under the new Io abstraction. The
    lldb-fallback tty detection was rewritten using std.posix.openat() and std.c.close() to get a raw fd for
    the ioctl call.

  • std.posix.getrandom() removed. Replaced with std.c.arc4random_buf(), which is natively available on
    macOS/Darwin.

  • std.time.sleep() and std.time.milliTimestamp() removed. The std.time module was stripped down to
    constants only. Two small helpers were added: sleepNs() wrapping std.c.nanosleep(), and milliTimestamp()
    wrapping std.c.gettimeofday().

  • std.fmt.fmtIntSizeBin() removed. The human-readable byte-size formatter was dropped from std.fmt.
    The FPS status line was updated to display raw byte counts instead.

@SonyCore SonyCore changed the title Port to zig 0.16 Zig 0.16 Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant